import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'
import Home from '../views/Home.vue'
import Users from '../views/users/Users.vue'
import Rights from '../views/auth/Rights.vue'
import Roles from '../views/auth/Roles.vue'
import Report from '../views/report/Report.vue'
import GoodsList from '../views/goods/GoodsList.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'login',
    component: Login
  },
  {
    path: '/home',
    name: 'home',
    component: Home,
    children: [
       { path:'/users' , component:Users },
       { path:'/rights' , component:Rights },
       { path:'/roles' , component:Roles },
       { path:'/reports' ,component:Report},
       { path:'/goods' ,component:GoodsList}
    ]
  }
]

const router = new VueRouter({
  base: 'taobao',
  routes
})

export default router
